package com.gu.utils;

import com.gu.VO.UserVO;
import com.gu.entity.UserDO;
import com.gu.enumeration.UserOccupationTypeEnum;
import com.gu.enumeration.UserStatusEnum;
import org.springframework.beans.BeanUtils;

/**
 * @ProjectName: apartment-management-center
 * @Package: com.gu.utils
 * @ClassName: UserDO2VO
 * @Author: gusongliao
 * @Description: 用于UserDO转VO类
 * @createDate 2021/04/03 13:59
 */
public class UserDO2VO {

    private UserDO userDO;


    public static UserVO userDO2UserVO(UserDO userDO){

        UserVO userVO = new UserVO();
        BeanUtils.copyProperties(userDO,userVO);
        userVO.setStatus(UserStatusEnum.getUserStatus(userDO.getStatus()));
        userVO.setOccupationType(UserOccupationTypeEnum.getUserOccupation(userDO.getOccupationType()));
        return userVO;
    }

}
